/*
 *    Copyright © OpenAtom Foundation.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.inspur.edp.bff.api.manager.context;

import com.inspur.edp.bff.api.manager.IFSManager;
import com.inspur.edp.bff.entity.defaultvalue.VoDefaultValue;
import com.inspur.edp.cef.entity.entity.IEntityData;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * 新增上下文
 * 新增前，新增，新增后扩展动作共用一个新增上下文
 * 扩展动作执行顺序可参考：<a href=https://open.inspuronline.com/iGIX/#/document/mddoc/docs-gsp-cloud-ds%2Fdev-guide-beta%2Fadvanced-development%2Fvo-relatedcomponent-development%2F%E6%89%A9%E5%B1%95%E5%8A%A8%E4%BD%9C%2Fvo%E6%89%A9%E5%B1%95%E5%8A%A8%E4%BD%9C.md">点击这里</a>查看
 */
public class RetrieveDefaultContext {
    /**
     * 获取新增的Vo数据，这里的数据指的是经过数据Mapping转换之后得到的vo数据集
     */
    private IEntityData retrieveDefaultResult;
    private HashMap<String, ArrayList<IEntityData>> retrieveDefaultData = new HashMap<String, ArrayList<IEntityData>>();
    private VoDefaultValue voDefaultValue;
    private String dataId;

    public final IEntityData getRetrieveDefaultResult() {
        return retrieveDefaultResult;
    }

    public final void setRetrieveDefaultResult(IEntityData value) {
        retrieveDefaultResult = value;
    }

    /**
     * 数据源新增结果集
     * Key：数据源编号，内部默认Key值使用Default，开发时请注意不要使用该Key值,以免出现未知问题。
     * Value：数据源新增数据
     */
    public final HashMap<String, ArrayList<IEntityData>> getRetrieveDefaultData() {
        return retrieveDefaultData;
    }

    public final void setRetrieveDefaultData(HashMap<String, ArrayList<IEntityData>> value) {
        retrieveDefaultData = value;
    }

    /**
     * 获取新增时设置的默认值
     *
     * @return
     * @see VoDefaultValue
     */
    public final VoDefaultValue getVoDefaultValue() {
        return voDefaultValue;
    }

    /**
     * 新增时设置默认值，可参考{@link IFSManager#retrieveDefault(VoDefaultValue)}中的参数设置
     *
     * @return
     * @see VoDefaultValue
     */
    public final void setVoDefaultValue(VoDefaultValue value) {
        voDefaultValue = value;
    }

    /**
     * 获取新增时设置的数据id
     *
     * @return
     */
    public final String getDataId() {
        return dataId;
    }

    /**
     * 设置新增数据id
     *
     * @param value
     */
    public final void setDataId(String value) {
        dataId = value;
    }
}
